home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 2000 #1
/
Amiga Plus CD - 2000 - No. 1.iso
/
Tools
/
Misc
/
InstallerNG
/
examples
/
properties.installer
< prev
next >
Wrap
Text File
|
1999-12-03
|
3KB
|
90 lines
/*
*
*
*/
(user expert)
(set @proceed-button "Show me more!"
@abort-button "Shit happens"
)
; *******************************************************************
; define some procedures (better: methods) which can
; operate on these objects
; this will show the content of an "person" object
(procedure P_showPerson
#p
(
(if (= "person" #p) ; check for the right type
(
(message "Person's properties are\n\n"
"Name: " (get-property #p "NAME") "\n"
"Birthday: " (get-property #p "BIRTH") "\n"
"Sex: " (if (get-property #p "SEX")
"Male"
"Female"
) "\n"
)
)
)
)
)
; set the properties of a symbol (or, in an object-oriented
; manner: set an objects attributes)
(procedure P_setPerson
#p
(
(if (= "person" #p)
(
(put-property #p "NAME" (askstring (prompt "Enter the name")
(help "")
(default "Savage")
)
)
(put-property #p "BIRTH" (askstring (prompt ("Enter %s's birthday" (get-property #p "NAME")))
(help "")
(default "01/01/1999")
)
)
(put-property #p "SEX" (askbool (prompt ("Enter %s's sex" (get-property #p "NAME")))
(help "")
(default 1)
(choices "Male" "Female")
)
)
)
)
)
)
; *******************************************************************
(message "Welcome to a really cool example!\n\n"
"This will show you the usage of the new functions\n"
"SET-PROPERTY, GET-PROPERTY, REMOVE-PROPERTY, which\n"
"make you able to do some very simple Object-Oriented\n"
"stuff with the new InstallerNG!\n\n"
"Enjoy..."
)
; *******************************************************************
; first declare a object (i.e. symbol); the value of one symbol may
; stand for the "type" of this object (i.e. its class)
(set #savage "person")
(message "First, give me some data!")
(P_setPerson #savage)
(message "Now let's see the data...")
(P_showPerson #savage)
(exit (quiet))
(welcome)